1. Field of the Invention
The present invention relates generally to graphics processing systems, and more specifically to an improved method and apparatus for managing the storage of depth data in a depth buffer of a graphics processing system.
2. Description of the Prior Art
FIG. 1 shows a generalized block diagram illustrating a typical prior art computer graphics system at 2 generally including: a graphics processing unit 4; a display unit 5 coupled with the graphics processing unit 4 via an interface 6; and a local memory unit 7 communicatively coupled with the graphics processing unit, the local memory unit providing temporary storage of image data for displaying a 3-dimensional (3-D) image on the display unit. The local memory unit 7 includes: a refresh buffer (not shown) for storing intensity values for each of a plurality of (x, y) pixel positions on the display unit 5; and at least one depth buffer, or Z buffer, 8 coupled with the graphics processing unit 4 via a Z buffer memory interface 9. In operation, the graphics processing unit 4 generates image data which is temporarily stored in the local memory unit 7, the image data including Z data which is temporarily stored in the Z buffer.
The graphics processing unit 4 typically includes a 3D graphics pipeline (not shown) for processing data in the form of object descriptions. Generally, object surfaces are formed by one or more polygon surfaces. Object descriptions are typically converted to projection coordinates by the graphics pipeline, each (x, y, z) position on a polygon surface corresponding to an orthographic projection point (x, y) on a view plane of a scene to be displayed. As object surfaces are generated by the graphics pipeline, it must be determined which of the surfaces located at each (x, y) pixel position is visible because portions of some object surfaces are obscured behind others and it must be determined which object surfaces are visible.
The Z buffer 8 is used in accordance with a Z buffer method of detecting the visible surfaces of objects defined in 3-D image space by comparing surface depths, that is the Z values, of the predefined objects. The Z buffer 8 is used as a scratch buffer for storing depth data including Z values for each of the (x, y) pixel positions of a 3-D image. The depth of a displayed object is usually measured from a view plane along the Z axis of a viewing system. Typically, Z values range from zero at a back clipping plane, which is furthest away, to a maximum value at a front clipping plane which is closest. The Z buffer 8 provides for storing the Z values for each of the (x, y) pixel positions as surfaces are processed.
In accordance with the Z buffer method, each surface of a scene to be displayed on the display unit 5 is processed separately. The Z buffer process is equivalent, for each point (x, y) to a search to find that point with the maximum Z value. Initially, all positions in the Z buffer are set to 0 (minimum depth). Each object surface is then processed by determining a current depth value at each associated (x, y) pixel position. Each of the current depth values is then compared to an associated previous depth value stored in the Z buffer 8, and if the current depth value is greater than the previous depth value, the current depth value is stored in its place.
The Z buffer 8 is usually implemented using at least one dynamic random access memory (DRAM) chip having a plurality of pins for connection to associated pins of the graphics processing unit 4, the pin connections comprising the Z buffer memory interface 9. Because the Z buffer memory interface 9 comprises a limited number of pin connections, the bandwidth of the interface 9 is limited and therefore the amount of Z data that can be accessed by the graphics processing unit in the Z buffer in a given period of time is limited. The bandwidth limitation of the interface 9 imposes a limit on the performance of the system because the graphics pipeline generates and compares Z data faster than the Z data can be accessed.
In some prior art graphics systems, the Z buffer 8 is implemented on the same IC chip as graphics processing unit 4 thereby allowing for an unlimited number of connections between the graphics processing unit and the Z buffer. However, this solution is not feasible because silicon real estate in the graphics processing unit 4 is very limited and very expensive.
What is needed is an improved method and apparatus for managing depth data in a graphics display system so that the performance of the graphics system is not limited by the time required to access the depth data.